﻿using System;

using LightningTools.BCSTesterMan.Common.Infrastructure;

namespace LightningTools.BCSTesterMan.ViewModel
{
    public class Error : ObservableObject
    {
        private string message;
        private string stacktrace;

        /// <summary>
        /// Initializes a new instance of the <see cref="Error"/> class.
        /// </summary>
        /// <param name="exception">The exception.</param>
        public Error(Exception exception)
        {
            Message = exception.Message;
            Stacktrace = exception.StackTrace;
        }

        /// <summary>
        /// Gets or sets the Error Message.
        /// </summary>
        /// <value>The message.</value>
        public string Message
        {
            get { return message; }
            set
            {
                message = value;
                RaisePropertyChanged("Message");
            }
        }

        /// <summary>
        /// Gets or sets the Error StackTrace.
        /// </summary>
        /// <value>The stack trace.</value>
        public string Stacktrace
        {
            get { return stacktrace; }
            set
            {
                stacktrace = value;
                RaisePropertyChanged("Stacktrace");
            }
        }
    }
}